package edu.java.homework.hw06;

import edu.java.homework.hw06.products.*;

public class Salad {

    // --- Instance Variables --------------------------------------------------
    private Vegetable[] vegs = null;
    private Fruit[] fruits = null;
    private MeatProduct[] meatProducts = null;
    private MilkProduct[] milkProducts = null;
    private EggProduct[] eggProducts = null;
    private Spice[] spices = null;

    private int price = 0;

    // --- Constructors --------------------------------------------------------
    public Salad() {
    }

    public Salad(Vegetable[] vegs, Fruit[] fruits, MeatProduct[] meatProducts,
	    MilkProduct[] milkProducts, EggProduct[] eggProducts, Spice[] spices) {
	this(vegs,fruits,meatProducts,milkProducts,eggProducts,spices,0);
    }

    public Salad(Vegetable[] vegs, Fruit[] fruits, MeatProduct[] meatProducts,
	    MilkProduct[] milkProducts, EggProduct[] eggProducts,
	    Spice[] spices, int price) {
	this.vegs = vegs;
	this.fruits = fruits;
	this.meatProducts = meatProducts;
	this.milkProducts = milkProducts;
	this.eggProducts = eggProducts;
	this.spices = spices;
	this.price=price;
    }

    // --- Methods -------------------------------------------------------------

    // --- Methods -> Getters and Setters --------------------------------------

    public Vegetable[] getVegs() {
	return vegs;
    }

    public void setVegs(Vegetable[] vegs) {
	this.vegs = vegs;
    }

    public Fruit[] getFruits() {
	return fruits;
    }

    public void setFruits(Fruit[] fruits) {
	this.fruits = fruits;
    }

    public MeatProduct[] getMeatProducts() {
	return meatProducts;
    }

    public void setMeatProducts(MeatProduct[] meatProducts) {
	this.meatProducts = meatProducts;
    }

    public MilkProduct[] getMilkProducts() {
	return milkProducts;
    }

    public void setMilkProducts(MilkProduct[] milkProducts) {
	this.milkProducts = milkProducts;
    }

    public EggProduct[] getEggProducts() {
	return eggProducts;
    }

    public void setEggProducts(EggProduct[] eggProducts) {
	this.eggProducts = eggProducts;
    }

    public Spice[] getSpices() {
	return spices;
    }

    public void setSpices(Spice[] spices) {
	this.spices = spices;
    }

    public int getPrice() {
	return price;
    }

    public void setPrice(int price) {
	// check input parameters
	if (price < 0) {
	    throw new IllegalArgumentException(
		    "Incorrect input. The price should be 0 or positive integer number");
	}
	this.price = price;
    }

}
